﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LAVAA.BL.Misc;
using LAVAA.DAL;

namespace LAVAA.BL.Business
{
    public class UserManager
    {
        private UnitOfWork _uow;
        public UserManager(UnitOfWork uow)
        {
            this._uow = uow;
        }

        public void AddUser(User user)
        {
            _uow.UserRepository.Add(user);
        }

        public void DeleteUser(Guid id)
        {
            _uow.UserRepository.Delete(id);
        }

        public void UpdateUser(User user)
        {
            User entityUser = _uow.UserRepository.GetById(user.Id);
            Utils.CopyPropertyValues(user, entityUser);
            _uow.UserRepository.Update(entityUser);
        }
    }
}
